﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using SharpMap.Rendering;

namespace SharpMap.Wpf.Rendering
{
    public class WpfVectorRenderObject : WpfRenderObject
    {

        public LayerStyle Style
        {
            get { return (LayerStyle)GetValue(StyleProperty); }
            set { SetValue(StyleProperty, value); }
        }

 
        public static readonly DependencyProperty StyleProperty =
            DependencyProperty.Register("Style", typeof(LayerStyle), typeof(WpfVectorRenderObject));

   
        public PathGeometryStyleHolder StyleInCurrnetState
        {
            get
            {
                switch (State)
                {
                     case RenderState.Normal:
                        return Style.NormalGeometry;
                        break;
                    case RenderState.Selected:
                        return Style.SelectedGeometry;
                        break;
                    case RenderState.Highlighted:
                        return Style.HighlightedGeometry;
                    case RenderState.Unknown:
                    default:
                        throw 
                            new Exception(String.Format(
                                "Render State can take only the following values: Normal, Selected, Highlighted. Value encountered: {0}",State));
                        
                }
            }
        }

        protected override Freezable CreateInstanceCore()
        {
            return new WpfRenderObject();
        }


    }
}
